
package ext.springMVC;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping({"/user"})
public class TestController {
    @RequestMapping(value = "/query",method = { RequestMethod.POST, RequestMethod.GET })    
    public void productSerialCombobox(HttpServletResponse response) throws Exception{
        boolean enforce = wt.session.SessionServerHelper.manager.setAccessEnforced(false);
        PrintWriter out = response.getWriter();
        response.setContentType("application/json; charset=UTF-8");
        try {
            JSONObject jo = new JSONObject();
            jo.put("name", "gaoxf");
            out.print(jo.toJSONString());
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            wt.session.SessionServerHelper.manager.setAccessEnforced(enforce);
        }
    }
}
